ABC129 B - Balance
https://atcoder.jp/contests/abc129/tasks/abc129_b
提出
code: python
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
res = abs(sum(w
0:i
) - sum(w
i:
))
if (res < ans):
ans = res
print(ans)